<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // var str = "i am a boy"
        // // var index = str.search(/\b/g)
        // // console.log(index)
        // var reg = /\d+/g
        // var flag = reg.test(str)
        // console.log(flag)

        var result = /e/g.exec("The best things in life are free!");
        var result = /e/g.exec("The best things in life are free!");
        var result = /e/g.exec("The best things in life are free!");

        console.log(result)
    </script>
</body>

</html>